
#ifndef _FIT_h
#define _FIT_h

#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <vector>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <fstream>
#include <math.h>
#include <sstream>

#include <stdlib.h>
#include <algorithm>
#include <numeric>

#include "Home.h"

#ifdef GSL
#include <gsl/gsl_multifit.h>
int DoFit(const gsl_multifit_robust_type *T, 
          const gsl_matrix *X, 
          const gsl_vector *y, gsl_vector *c, 
          gsl_matrix *cov);
#endif

void RobustMultiFit(const Table_t &table, 
                    const int xId, const int yId, // index in the table
                    double &c0, double &c1, /* out parameters */ 
                    Table_t &fitTable);

#endif